#ifndef _SHELDON_SPOT__H
#define _SHELDON_SPOT__H

#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined (__GNUC__)
	#define SHELDON_SPOT_USED				__attribute__((used))
	#define SHELDON_SPOT_SECTION(x)			__attribute__((section(x)))
#endif


typedef void (*sheldon_init_func_t)(void);
#define SHELDON_SPOT_EXPORT(fn, level) 		\
		SHELDON_SPOT_USED const sheldon_init_func_t init_##fn SHELDON_SPOT_SECTION(".SHELDON_SPOT_fn."level) = fn


#define SHELDON_SPOT_HIGHEST_EXPORT(fn)     	SHELDON_SPOT_EXPORT(fn, "1")
#define SHELDON_SPOT_MID_HIGH_EXPORT(fn)        SHELDON_SPOT_EXPORT(fn, "2")
#define SHELDON_SPOT_MID_EXPORT(fn)      		SHELDON_SPOT_EXPORT(fn, "3")
#define SHELDON_SPOT_MID_LOW_EXPORT(fn) 		SHELDON_SPOT_EXPORT(fn, "4")
#define SHELDON_SPOT_LOWEST_EXPORT(fn) 			SHELDON_SPOT_EXPORT(fn, "5")

void sheldon_spot_init(void);

#endif
